package com.mybatisplus.utils;

import com.sun.istack.internal.NotNull;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Create By GuoZhengRong
 * File was Created on {YEAR} {DATE} {TIME}
 * Create By IntelliJ IDEA
 **/
public class ToHttpServletUtil {
    public static HttpServletRequest toHttpServletRequest(@NotNull ServletRequest request) {
        if (request != null)
            return (HttpServletRequest) request;
        else throw new NullPointerException("request is null!");
    }

    public static HttpServletResponse toHttpServletResponse(@NotNull ServletResponse response) {
        if (response != null)
            return (HttpServletResponse) response;
        else throw new NullPointerException("response is null!");
    }
}
